#ifndef   __KEY_H
#define   __KEY_H
			   
//#define    P_KEY_STEREO         P2_5
//#define    P_KEY_CAMPUS         P2_4
//#define    P_KEY_GET_CHAN       P2_3


#define    P_KEY_CHAN_DEC       P2_5
#define    P_KEY_CHAN_INC       P2_4
#define    P_KEY_POWER          P2_3
#define    P_KEY_VOL_DEC        P2_2
#define    P_KEY_VOL_INC        P2_1

#define    P_KEY_SAVE_CHAN      P2_5

#define    P_5V                 P3_0
#define    P_CHRG               P3_1

struct KEY_STRUCT
{
  uint8_t   bitShortClickTmp;      //
  uint8_t   bitShortClick;         //
  uint8_t   bitLock;               //
  uint8_t   bitLongClick;          //
  uint16_t  PinNow;
  uint16_t  PinLast;
  uint16_t  count1;               //
  uint16_t  count2;
  uint16_t  KeyValue;
};
extern struct KEY_STRUCT structKey;

#define   SWITCH_5V          0
#define   SWITCH_CHRG        1
#define   SWITCH_MAX         2
#if 1
struct SWITCH_STRUCT
{
  uint8_t bitStatus;
  uint8_t u8count1;
  uint8_t u8count2;
};
extern struct SWITCH_STRUCT structSwitch[SWITCH_MAX];
#endif

void scan_key(void);
void scan_switch(void);
void key_service(void);
uint8_t get_chan_dec_key_status(void);
uint8_t get_chan_inc_key_status(void);
#endif
